home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 325 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: unrza3.dialin.rrze.uni-erlangen.de!not-for-mail
  2. From: mskuhn@unrza3.dialin.rrze.uni-erlangen.de (Markus Kuhn)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Binary Mode stdin/stdout
  5. Date: 8 Feb 1996 02:39:13 +0100
  6. Organization: Markus Kuhn, 91080 Uttenreuth, Germany
  7. Message-ID: <4fbk81$qk@cortex.dialin.rrze.uni-erlangen.de>
  8. References: <4f67kg$11g@cortex.dialin.rrze.uni-erlangen.de> <DME74w.4M4@stdc.demon.co.uk>
  9. Reply-To: mskuhn@cip.informatik.uni-erlangen.de
  10. NNTP-Posting-Host: unrza3.dialin.rrze.uni-erlangen.de
  11.  
  12. clive@stdc.demon.co.uk (Clive D.W. Feather) writes:
  13.  
  14. >In article <4f67kg$11g@cortex.dialin.rrze.uni-erlangen.de>,
  15. >Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de> wrote:
  16. >> Why isn't there a standard way of allowing an ISO C program to switch
  17. >> the standard input and output into binary transparent mode (as with
  18. >> the "b" flag in fopen()/freopen() for normal files)?
  19. >>
  20. >> Has this just been forgotten or is there a good technical reason?
  21.  
  22. >On some implementations, this decision has to be made at the time you
  23. >open the file and can't be changed.
  24.  
  25. I would already be happy with a portable function that allows to
  26. switch stdin or stdout to binary mode and that has only a well-defined
  27. behaviour according to the standard if this switch occurs before any
  28. byte has been written to or read from the stream. This would cause no
  29. headaches on your computing fossil (because inserting a newline during
  30. a later switch would not be non-conforming) and would be sufficient
  31. for all important applications I can think of (like zcat).
  32.  
  33. Markus
  34.  
  35. -- 
  36. Markus Kuhn, Computer Science student -- University of Erlangen,
  37. Internet Mail: <mskuhn@cip.informatik.uni-erlangen.de> - Germany
  38. WWW Home: <http://wwwcip.informatik.uni-erlangen.de/user/mskuhn>
  39.